<%@ page language="java" pageEncoding="utf-8" import="java.util.*"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${topic.subject } -- ${forum.forumName } -- 浏览主题</title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript" src="${ctx }/fckeditor/fckeditor.js"></script>
<script>
	var sBasePath = "${ctx }/fckeditor/";
</script>
<!--  ckeditor测试-->
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
	window.onload = function() {
		var sBasePath = "/mybbs/fckeditor/";
		var oFCKeditor = new FCKeditor('post.text');
		oFCKeditor.BasePath = sBasePath;
		oFCKeditor.ReplaceTextarea();
	}
</script>
<!--ckeditor测试-->
</head>
<body class="zh_CN">
<table width="100%" border="0">
	<tr>
		<td><%@ include file="/common/header.jsp"%></td>
	</tr>
	<tr>
		<td>
		<table cellspacing="0" cellpadding="10" width="90%" align="center"
			border="0">
			<tr>
				<td class="bodyline" valign="top">
				<table cellspacing="2" cellpadding="2" width="100%" align="center">
					<tr>
						<td><span class="mainmenu"> <a id="backtosite"
							class="mainmenu" href="${ctx}"> 首页</a> &gt;&gt;<a
							class="mainmenu"
							href="forumadmin.action?method:listTopics=&forumId=${topic.forum.id}">${forum.forumName}</a>&gt;&gt;${topic.subject}<s:url
							id="topicDisplayUrl" action='forum' includeParams="none">
							<s:param name="method:displayTopic"></s:param>
							<s:param name="postId">${post.id}</s:param>
						</s:url> </span></td>
					</tr>
				</table>
				<table width="100%" border="0">
					<c:set var="method_param" value="displayTopic" />
					<%@ include file="/common/paginationForum.jsp"%>
				</table>
				<table class="forumline" cellspacing="1" cellpadding="3"
					width="100%" border="0" id="forumList">
					<tr>
						<th class="thleft" nowrap="nowrap" height="26" width="200">发帖人</th>
						<th class="thright" nowrap="nowrap">内容</th>
					</tr><tr>
					<td colspan="2">
							<div class="postinfo">
							<div class="subject">&nbsp;&nbsp; &nbsp;<b>文章主题:</b>${topic.subject}
							</div>
							</div>
							</td></tr>
					<tr>
                       
						<td class="row2" valign="top" align="left"><span
							class="genmed"><b>${topic.create.username}</b></span> <br />
						<span class="gensmall"> <br />
						<br />
						</span> <br />
						</td>

						<td class="row2" valign="top" id="post_text_${topic}"><span
							class="postbody">${topic.text} </span></td>
					</tr>
					<c:forEach var="post" items="${posts}"
						varStatus="status">
						<tr>
							<td colspan="2">
							<div class="postinfo">
							<div class="subject">&nbsp;&nbsp; &nbsp;<b>文章主题:</b>${post.subject
							} <a
								href="${ctx }/forum/adminforum.action?method:postTopicForm&post.id=${post.id}">编辑</a>&nbsp;&nbsp;<a
								href="forumadmin.action?method:deletePost&post.id=${post.id}">删除</a>
							</div>
							</div>
							</td>
						</tr>
						<tr>
							<td class="row2" valign="top" align="left"><span
								class="genmed"></span> <br />
							<span class="gensmall"><b>${post.creator.username}</b><br/>
							<br />
							</span> <br/>
							</td>
							<!-- Message -->
							<td class="row2" valign="top">
							<span class="postbody">${post.text }</span>
							</td>
						</tr>
						<tr align="center">
							<td class="catbottom" colspan="2" height="20" align="right">
							<table cellspacing="0" cellpadding="0" border="0">
								<tr>
									<td align="center"><span class="gensmall"></span></td>
								</tr>
							</table>
							</td>
						</tr>
					</c:forEach>
				</table>
				<form action="forumadmin.action?method:reply" method="post"
					enctype="multipart/form-data"><input name="topicId"
					type="hidden" value="${topicId}" />
				<table cellspacing="1" cellpadding="1" width="100%" border="0">
					<tr>
						<td align="left" width="2%" nowrap="nowrap">标题:</td>
						<td align="left"><input name="post.subject" type="text"
							value="回复：${topic.subject }" style="width: 100%" /></td>
					</tr>
					<tr>
						<td colspan="2"><textarea id="post_text" name="post.text"
							onfocus="initFckeditor()" rows="8"></textarea></td>
					</tr>
					<tr>
						<td width="8%">附件上传：</td>
						<td><input name="file" type="file" /></td>
					</tr>
					<tr>
						<td><input class="mainoption" type="submit" value="保存" /></td>
					</tr>
				</table>
				</form>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td><%@ include file="/common/footer.jsp"%></td>
	</tr>
</table>
</body>
</html>